package cn.anythy.onebuilder.config;


import cn.hutool.core.util.StrUtil;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.Map;

/**
 * 项目包结构的配置项
 *
 * @author one-builder
 */

@Data
@Accessors(chain = true)
public class PackageConfig {

    /**
     * 父包名
     */
    private String parent = "cn.anythy";
    /**
     * 父包模块名
     */
    private String moduleName = "one";
    /**
     * Entity包名
     */
    private String entity = "entity";
    /**
     * Service包名
     */
    private String service = "service";
    /**
     * Service Impl包名
     */
    private String serviceImpl = "service.impl";
    /**
     * Mapper包名
     */
    private String mapper = "mapper";
    /**
     * Mapper XML包名
     */
    private String xml = "mapper.xml";
    /**
     * Controller包名
     */
    private String controller = "controller";
    /**
     * 路径配置信息
     */
    private Map<String, String> pathInfo;

    /**
     * 父包名
     */
    public String getParent() {
        if (StrUtil.isNotEmpty(moduleName)) {
            return parent + StrUtil.DOT + moduleName;
        }
        return parent;
    }
}
